package bigbeard.tools.net.client;

import bigbeard.tools.net.api.client.IClient;
import bigbeard.tools.net.client.impl.TcpClientImpl;
import bigbeard.tools.net.client.impl.UdpClientImpl;
import bigbeard.tools.net.client.impl.WebsocketClientImpl;
import bigbeard.tools.net.utils.Utils;

/**
 * @author bigbeard on 2022-09-29
 */
public class NetClientFactory {


    public static IClient create(String protocol) {
        protocol = protocol.toLowerCase();
        switch (protocol) {
            case Utils.WEB_SOCKET:
                return new WebsocketClientImpl();
            case Utils.TCP_CLIENT:
                return new TcpClientImpl();
            case Utils.UDP_CLIENT:
                return new UdpClientImpl();
            default:
                return null;
        }
    }

}
